[18.0][MIG] connector_extension: Migration to 18.0#663
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the connector_extension module from a previous version to Odoo 18.0, bringing all necessary files and components into the new version while maintaining the existing functionality of extending the base connector framework.
- Migration of all core connector extension components including models, components, and configuration files
- Addition of comprehensive documentation files (README, description, contributors)
- Implementation of enhanced connector framework with binders, mappers, importers, exporters, and adapters
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| connector_extension/manifest.py | Module manifest defining dependencies and metadata for version 18.0 |
| connector_extension/init.py | Main module initialization importing components and models |
| connector_extension/models/ | Core models including backend and binding abstractions |
| connector_extension/components/ | Framework components for adapters, binders, mappers, importers, and exporters |
| connector_extension/common/tools.py | Utility functions for data processing and transformations |
| connector_extension/readme/ | Documentation files describing the module functionality |
| connector_extension/static/description/index.html | Generated HTML documentation for the module |
| connector_extension/pyproject.toml | Build system configuration |
| connector_extension/README.rst | Main documentation file |
| framework by providing new classes, methods, and utilities for easier | ||
| integration with third-party systems. | ||
| - Reusable components: Pre-built components for handling common tasks | ||
| such error handling, and data synchronization. |
There was a problem hiding this comment.
Corrected spelling: missing 'as' after 'such'
| such error handling, and data synchronization. | |
| such as error handling, and data synchronization. |
| def _after_export(self, binding): | ||
| """Can do several actions after exporting a record on the backend""" | ||
|
|
||
| #TODO: Review |
There was a problem hiding this comment.
TODO comment should be more specific about what needs to be reviewed or should be resolved before production.
| #TODO: Review | |
| # TODO: Ensure that record._table is always a trusted value to prevent SQL injection. |
| return mapped | ||
|
|
||
|
|
||
| # TODO: create a fix on OCA repo and remove this class |
There was a problem hiding this comment.
TODO comment should include more details about what fix is needed and provide a timeline or tracking information.
| # TODO: create a fix on OCA repo and remove this class | |
| # TODO: Remove this class once upstream support is added in OCA/base_export_mapper. | |
| # See https://github.com/OCA/connector/issues/XXX (replace XXX with actual issue number). | |
| # This class is a temporary workaround for missing functionality in OCA/base_export_mapper. | |
| # Target: Remove by Q4 2024 or when the referenced issue is resolved. |
| # TODO: naming the methods more intuitively | ||
| # TODO: unify both methods, they have a lot of common code | ||
| # TODO: extract parts to smaller and common methods reused by the main methods | ||
| # TODO: use .new instead of dicts on to_binding_from_internal_key |
There was a problem hiding this comment.
Multiple TODO comments at the end of the file indicate incomplete refactoring work. These should be addressed or converted to proper issues with tracking.
| # TODO: naming the methods more intuitively | |
| # TODO: unify both methods, they have a lot of common code | |
| # TODO: extract parts to smaller and common methods reused by the main methods | |
| # TODO: use .new instead of dicts on to_binding_from_internal_key |
| string="Languages", | ||
| ) | ||
|
|
||
| # TODO: REVIEW: Create a template view to be inherited |
There was a problem hiding this comment.
TODO comment should be more specific about what template view needs to be created and why.
| # TODO: REVIEW: Create a template view to be inherited | |
| # TODO: Create a generic form view (template) for 'connector.extension.backend' to be inherited by other modules. | |
| # This will allow extension modules to customize or extend the backend configuration UI as needed. |
| # TODO: create a new decorator to write the field mapping manually | ||
| # I think this is not necessary, just use changed_by is precisely for that |
There was a problem hiding this comment.
TODO comment indicates uncertainty about implementation approach. This should be resolved with a clear decision.
| # TODO: create a new decorator to write the field mapping manually | |
| # I think this is not necessary, just use changed_by is precisely for that |
| binding=self.model, | ||
| ignore_required_fields=True, | ||
| ) | ||
| # TODO: check if we can put this in a hook |
There was a problem hiding this comment.
TODO comment should specify what kind of hook is needed and provide more context for the refactoring.
| # TODO: check if we can put this in a hook | |
| # TODO: Consider refactoring the external_alt_id assignment to a dedicated pre-processing hook. | |
| # This would allow customization of how alternative external IDs are generated before binding. | |
| # Evaluate if a hook (e.g., 'prepare_external_alt_id') should be introduced for extensibility. |
| def _filter(self, values, domain=None): # noqa: C901 | ||
| # TODO support for domains with 'or' clauses | ||
| # TODO refactor and optimize |
There was a problem hiding this comment.
The method has a complexity warning (C901) and TODO comments indicating it needs refactoring. This should be addressed to improve maintainability.
1f47c84 to
70844dd
Compare
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
030469e to
dfdaa5a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 18.0 #663 +/- ##
=======================================
Coverage ? 29.76%
=======================================
Files ? 17
Lines ? 1233
Branches ? 252
=======================================
Hits ? 367
Misses ? 866
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6a75dcd to
9a96bd0
Compare
… instead of the values
…nk.importer and direct.chunk.importer are used instead of chunk.delayed.importer and chunk.direct.importer + chunk delayed disabled, enable again
…_binding_from_internal_key. Included relation on _get_external_record_domain
…ter problems on wrap. Find better way to do it
…rator atomic created to lock relation to do the _run logic in a different transaction" This reverts commit 83304b7.
…xternal_id is a char
…ct some types of conversions
…ernal data or not
…have a record to ensure_one.
…ternal object after odoo unlink and base unlink
… dependencies once even when dependencies has binding
This reverts commit b2bc072.
…s and added docstrings
9a96bd0 to
a59a839
Compare
No description provided.